package com.example.myapp;

import com.example.myapp.entity.SolarTermBean;
import com.example.myapp.utils.Constants;
import com.google.gson.Gson;

import java.util.ArrayList;
import java.util.List;

public class TestTool {

    public static void main(String[] args) {

        List<SolarTermBean> list= new ArrayList<>();
        for (int i = 1; i <=24 ; i++) {
            SolarTermBean solarTermBean = new SolarTermBean();
            solarTermBean.setId(i);
            solarTermBean.setTitle(Constants.solarTermTitle[i]);
            solarTermBean.setContent(Constants.solarTermContents[i]);
            solarTermBean.setImageUrl(Constants.solarTermUrlImages[i]);
            list.add(solarTermBean);
        }

        Gson gson = new Gson();
        String json = gson.toJson(list);
        System.out.println(json);


    }
}
